package com.clkj.mobileinspector.model;



import com.lws.basic.utils.common.MyLogger;
import com.lws.basic.utils.common.MyToast;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * ui层用来访问网络结果的观察者
 */

public abstract class ObserverOnNext<T> implements Observer<T> {

    @Override
    public void onSubscribe(Disposable d) {

    }

    @Override
    public void onComplete() {

    }


    @Override
    public void onError(Throwable e) {


//        if (e.getMessage().contains("failed to connect to") ||e.getMessage().contains("Failed to connect to")){
//            MyToast.show("连接服务器好像出错了");
//        }else if (e.getMessage().equals("timeout")){
//            MyToast.show("请求超时 返回重试");
//        } else {
            MyToast.show(e.getMessage());
  //      }


            MyLogger.e("错误"+e.getMessage());
//        CrashReport.postCatchedException(e);

    }
}
